<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">

<head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8">

    <title>添加员工页面</title>
    <link rel="stylesheet" type="text/css" href="http://localhost:8080/layui-v2.7.6/layui/css/layui.css">
    <!--引入js-->
    <script src="http://localhost:8080/layui-v2.7.6/layui/layui.js" type="text/javascript" charset="utf-8"></script>
</head>
<body>
<div class="layui-container">
    <div class="layui-row">
        <form class="layui-form layui-form-pane" id="editForm" action="" style="margin-top: 20px" lay-filter="form">
            <div class="layui-form-item">
                <input type="hidden" id="bookId" name="bookId" th:value="${book.bookId}">
                <label class="layui-form-label">书籍名称</label>
                <div class="layui-input-block">
                    <input type="text" id="bookName" th:value="${book.bookName}" name="bookName" autocomplete="off"
                           placeholder="请输入"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">书籍数量</label>
                <div class="layui-input-block">
                    <input type="text" id="bookCounts" th:value="${book.bookCounts}" name="bookCounts"
                           autocomplete="off" placeholder="请输入"
                           lay-verify="required"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">书籍类型</label>
                <div class="layui-input-block">
                    <select id="bookType" name="type">
                        <option th:each="item:${bookTypeList}" th:text="${item==1?'计算机技术':(item==2?'投资之道':'娱乐')}"
                                th:value="${item}"
                                th:selected="${item==book.type}">
                        </option>
                    </select>
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">书籍详情</label>
                <div class="layui-input-block">
                    <input type="text" id="detail" th:value="${book.detail}" name="detail" autocomplete="off"
                           placeholder="请输入"
                           lay-verify="required"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item" pane>
                <label class="layui-form-label" style="padding: 8px 1px">储备是否充足</label>
                <div class="layui-input-block">
                    <input th:checked="${book.storage==1}" type="radio" name="storage" value="1" title="是">
                    <input th:checked="${book.storage==0}" type="radio" name="storage" value="0" title="否">
                </div>
            </div>
            <div class="layui-form-item">
                <label class="layui-form-label">入库日期</label>
                <div class="layui-input-block">
                    <input id="date" type="text" th:value="${#dates.format(book.date,'yyyy-MM-dd HH:mm:ss')}"
                           name="date" autocomplete="off" placeholder="入库日期" lay-verify="required"
                           class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <button class="layui-btn" lay-submit lay-filter="updateBook" id="updateBook">保存</button>
                <button type="reset" class="layui-btn layui-btn-primary" id="clearForm">重置</button>
            </div>
        </form>
    </div>

</div>
<script src="http://localhost:8080/js/edit.js" type="text/javascript" charset="utf-8"></script>
</body>
</html>